<form method="post" action="<?php echo $this->baseurl("/developer/clearcache");?>">
<?php  echo $this->callElement("default/tools/tool_bar",array("buttons"=>array(array('type'=>'back')),"custom_html"=> App::Helper("Html")->ButtonTag("ClearDbLog","Clear",array("onclick"=>"document.location='" . $this->baseurl("/developer/debug-log/{$mode}/clear") . "';")) ,"title" => "Debug Log")); ?>

<?php if($mode == 'file'):?>
    <textarea class="app_input" style="height:300px;width:99%;margin:auto" readonly="readonly"><?php echo $logData;?></textarea>
<?php else:?>
    <?php
        if(!empty($logData['data'])):
            $Grid = App::Module('DataGrid');
            foreach($logData['data'] as $row):
                $Grid->addRow($row['id'],$row['fkey'],$row['type'],App::Helper('Date')->dateFormated($row['dated'],'long'),App::Helper('Html')->textareaTag('Log',$row['data'],Array("readonly"=>"readonly",'style'=>'width:100%')));
            endforeach;
            $Grid->setHeader(Array('ID','Ref#','Type','Dated','Message'));
            $Grid->setFooter("{$logData['link']} {$logData['paging']}");
            $Grid->render();
        else:
            echo $this->callElement('default/tools/message', array('caption' =>'Message','type' => 'success', 'message' => "No Log found to display"));
        endif;
    ?>
<?php endif;?>

<?php  echo $this->callElement("default/tools/tool_bar",array("buttons"=>array(array('type'=>'back') ) ,"position" => 'bottom')); ?>
</form>

    